<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">


<!-- Mirrored from www.zi-han.net/theme/hplus/login.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:18:23 GMT -->
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>502工作室后台管理 - 登录</title>
    <script src="https://libs.baidu.com/jquery/2.0.0/jquery.js"></script>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="favicon.ico"> <link th:href="@{/css/bootstrap.min14ed.css}" rel="stylesheet">
    <link th:href="@{/css/font-awesome.min93e3.css}" rel="stylesheet">

    <link th:href="@{/css/animate.min.css}" rel="stylesheet">
    <link th:href="@{/css/style.min862f.css}" rel="stylesheet">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>if(window.top !== window.self){ window.top.location = window.location;}</script>
</head>

<body class="gray-bg">

    <div class="middle-box text-center loginscreen  animated fadeInDown">
        <div>
            <div>

                <h1 class="logo-name">502</h1>

            </div>
            <h3>欢迎进入502工作室</h3>

            <!--// action="/geekdaily/adminLogin"    action="/geekdaily/doLogin"-->
            <form class="m-t" method="post" enctype="multipart/form-data">
                <div class="form-group">
                    <input type="text" id="username" name="username" class="form-control" placeholder="用户名" required="">
                </div>
                <div class="form-group">
                    <input type="password" id="password" name="password" class="form-control" placeholder="密码" required="">
                </div>
                <!--<button type="submit" class="btn btn-primary block full-width m-b">登 录</button>-->
                <button type="button" class="btn btn-primary block full-width m-b" onclick="login()">登 录</button>

                <p class="text-muted text-center"> <a href=""><small>忘记密码了？</small></a> | <a href="/geekdaily/register">注册一个新账号</a>
                </p>

            </form>
        </div>
    </div>
    <!--<script src="js/jquery.min.js?v=2.1.4"></script>-->
    <!--<script src="js/bootstrap.min.js?v=3.3.6"></script>-->
    <!--<script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>-->
    <script>
        function login() {
            var username = document.getElementById("username").value;
            var password = document.getElementById("password").value;
            $.ajax({
                type: "POST",
                url: "/geekdaily/login",
                data: {"username":username,"password":password},
                cache: false, //不缓存此页面
                success: function(data){
                    //前端调用成功后，可以处理后端传回的json格式数据。
                    if(data.code == 0){
                        // console.log("成功："+data.msg);
                        //想跳转到某个html页面怎么写
                        window.location.href = "/geekdaily/index";
                    }else {
                        window.alert(data.msg);
                    }
                },
                error:function (data) {
                    window.alert(data.msg);
                }
            })

        }
    </script>

</body>


<!-- Mirrored from www.zi-han.net/theme/hplus/login.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:18:23 GMT -->
</html>
